<?php

class Task extends Model_Abstract
{
	public function a()
	{
		try
		{
			$sql = "select created, site_id, firstname, lastname, email, cam, pub, pla, ip, birthday, fired from users where created>=1330578000 and created<1333252800 and pub in ('CD2', 'CD46', 'CD75', 'CD39', 'CD10125', 'CD40', 'CD56', 'CD19', 'CD115', 'CD59', 'CD77', 'CD78', 'CD96', 'CD10127', 'CD10128', 'CD10147') order by pub, created";
			return $this->_connection->query($sql);
		}
		catch (Exception $e)
		{
			QLog::log(__CLASS__.' '.__METHOD__.' --- '.$e->getMessage(), QLog::ERR);
			throw new Model_Exception($e->getMessage(), $e->getCode());
		}
	}
	
	public function b()
	{
		try
		{
			$sql = "select created, site_id, firstname, lastname, email, pub, pla, ip, fired from users where created>=1333252800 and created<1334721600 and pub in ('CD10137') order by pub, created";
			return $this->_connection->query($sql);
		}
		catch (Exception $e)
		{
			QLog::log(__CLASS__.' '.__METHOD__.' --- '.$e->getMessage(), QLog::ERR);
			throw new Model_Exception($e->getMessage(), $e->getCode());
		}
	}
	
	public function c()
	{
		try
		{
			$sql = "select sendto, sendfrom, subject, 0 as register, sent_date, open_time_date from emails where email_type='offersofweek' and open_time_date>0 order by sent_date";
			return $this->_connection->query($sql);
		}
		catch (Exception $e)
		{
			QLog::log(__CLASS__.' '.__METHOD__.' --- '.$e->getMessage(), QLog::ERR);
			throw new Model_Exception($e->getMessage(), $e->getCode());
		}
	}
}
?>